<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Mocks::MessageExpectation</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Mocks::MessageExpectation</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/mocks/message_expectation_rb.html">
                vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="BaseExpectation.html">
                BaseExpectation
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000233">advise</a>&nbsp;&nbsp;
      <a href="#M000240">any_number_of_times</a>&nbsp;&nbsp;
      <a href="#M000237">at_least</a>&nbsp;&nbsp;
      <a href="#M000238">at_most</a>&nbsp;&nbsp;
      <a href="#M000236">exactly</a>&nbsp;&nbsp;
      <a href="#M000227">expected_messages_received?</a>&nbsp;&nbsp;
      <a href="#M000234">generate_error</a>&nbsp;&nbsp;
      <a href="#M000228">ignoring_args?</a>&nbsp;&nbsp;
      <a href="#M000229">matches_at_least_count?</a>&nbsp;&nbsp;
      <a href="#M000230">matches_at_most_count?</a>&nbsp;&nbsp;
      <a href="#M000231">matches_exact_count?</a>&nbsp;&nbsp;
      <a href="#M000225">matches_name_but_not_args</a>&nbsp;&nbsp;
      <a href="#M000245">negative_expectation_for?</a>&nbsp;&nbsp;
      <a href="#M000241">never</a>&nbsp;&nbsp;
      <a href="#M000242">once</a>&nbsp;&nbsp;
      <a href="#M000244">ordered</a>&nbsp;&nbsp;
      <a href="#M000246">set_expected_received_count</a>&nbsp;&nbsp;
      <a href="#M000232">similar_messages</a>&nbsp;&nbsp;
      <a href="#M000239">times</a>&nbsp;&nbsp;
      <a href="#M000243">twice</a>&nbsp;&nbsp;
      <a href="#M000226">verify_messages_received</a>&nbsp;&nbsp;
      <a href="#M000235">with</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000233" class="method-detail">
        <a name="M000233"></a>

        <div class="method-heading">
          <a href="#M000233" class="method-signature">
          <span class="method-name">advise</span><span class="method-args">(args, block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000233-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 218</span>
218:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">advise</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>)
219:         <span class="ruby-identifier">similar_messages</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">args</span>
220:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000240" class="method-detail">
        <a name="M000240"></a>

        <div class="method-heading">
          <a href="#M000240" class="method-signature">
          <span class="method-name">any_number_of_times</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000240-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000240-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 255</span>
255:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">any_number_of_times</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
256:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
257:         <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-identifier">:any</span>
258:         <span class="ruby-keyword kw">self</span>
259:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000237" class="method-detail">
        <a name="M000237"></a>

        <div class="method-heading">
          <a href="#M000237" class="method-signature">
          <span class="method-name">at_least</span><span class="method-args">(n)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000237-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 240</span>
240:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_least</span>(<span class="ruby-identifier">n</span>)
241:         <span class="ruby-identifier">set_expected_received_count</span> <span class="ruby-identifier">:at_least</span>, <span class="ruby-identifier">n</span>
242:         <span class="ruby-keyword kw">self</span>
243:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000238" class="method-detail">
        <a name="M000238"></a>

        <div class="method-heading">
          <a href="#M000238" class="method-signature">
          <span class="method-name">at_most</span><span class="method-args">(n)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000238-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 245</span>
245:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at_most</span>(<span class="ruby-identifier">n</span>)
246:         <span class="ruby-identifier">set_expected_received_count</span> <span class="ruby-identifier">:at_most</span>, <span class="ruby-identifier">n</span>
247:         <span class="ruby-keyword kw">self</span>
248:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000236" class="method-detail">
        <a name="M000236"></a>

        <div class="method-heading">
          <a href="#M000236" class="method-signature">
          <span class="method-name">exactly</span><span class="method-args">(n)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000236-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 235</span>
235:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exactly</span>(<span class="ruby-identifier">n</span>)
236:         <span class="ruby-identifier">set_expected_received_count</span> <span class="ruby-identifier">:exactly</span>, <span class="ruby-identifier">n</span>
237:         <span class="ruby-keyword kw">self</span>
238:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000227" class="method-detail">
        <a name="M000227"></a>

        <div class="method-heading">
          <a href="#M000227" class="method-signature">
          <span class="method-name">expected_messages_received?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000227-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 193</span>
193:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expected_messages_received?</span>
194:         <span class="ruby-identifier">ignoring_args?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">matches_exact_count?</span> <span class="ruby-operator">||</span>
195:            <span class="ruby-identifier">matches_at_least_count?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">matches_at_most_count?</span>
196:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000234" class="method-detail">
        <a name="M000234"></a>

        <div class="method-heading">
          <a href="#M000234" class="method-signature">
          <span class="method-name">generate_error</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000234-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 222</span>
222:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate_error</span>
223:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">similar_messages</span>.<span class="ruby-identifier">empty?</span>
224:           <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_expectation_error</span>(<span class="ruby-ivar">@sym</span>, <span class="ruby-ivar">@expected_received_count</span>, <span class="ruby-ivar">@actual_received_count</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@args_expectation</span>.<span class="ruby-identifier">args</span>)
225:         <span class="ruby-keyword kw">else</span>
226:           <span class="ruby-ivar">@error_generator</span>.<span class="ruby-identifier">raise_unexpected_message_args_error</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@similar_messages</span>.<span class="ruby-identifier">first</span>)
227:         <span class="ruby-keyword kw">end</span>
228:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000228" class="method-detail">
        <a name="M000228"></a>

        <div class="method-heading">
          <a href="#M000228" class="method-signature">
          <span class="method-name">ignoring_args?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000228-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 198</span>
198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ignoring_args?</span>
199:         <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:any</span>
200:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000229" class="method-detail">
        <a name="M000229"></a>

        <div class="method-heading">
          <a href="#M000229" class="method-signature">
          <span class="method-name">matches_at_least_count?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000229-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 202</span>
202:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_at_least_count?</span>
203:         <span class="ruby-ivar">@at_least</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@actual_received_count</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@expected_received_count</span>
204:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000230" class="method-detail">
        <a name="M000230"></a>

        <div class="method-heading">
          <a href="#M000230" class="method-signature">
          <span class="method-name">matches_at_most_count?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000230-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 206</span>
206:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_at_most_count?</span>
207:         <span class="ruby-ivar">@at_most</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@actual_received_count</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@expected_received_count</span>
208:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000231" class="method-detail">
        <a name="M000231"></a>

        <div class="method-heading">
          <a href="#M000231" class="method-signature">
          <span class="method-name">matches_exact_count?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000231-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 210</span>
210:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_exact_count?</span>
211:         <span class="ruby-ivar">@expected_received_count</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@actual_received_count</span>
212:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000225" class="method-detail">
        <a name="M000225"></a>

        <div class="method-heading">
          <a href="#M000225" class="method-signature">
          <span class="method-name">matches_name_but_not_args</span><span class="method-args">(sym, args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000225-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 180</span>
180:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">matches_name_but_not_args</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-identifier">args</span>)
181:         <span class="ruby-ivar">@sym</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">sym</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@args_expectation</span>.<span class="ruby-identifier">args_match?</span>(<span class="ruby-identifier">args</span>)
182:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000245" class="method-detail">
        <a name="M000245"></a>

        <div class="method-heading">
          <a href="#M000245" class="method-signature">
          <span class="method-name">negative_expectation_for?</span><span class="method-args">(sym)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000245-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 285</span>
285:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">negative_expectation_for?</span>(<span class="ruby-identifier">sym</span>)
286:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
287:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000241" class="method-detail">
        <a name="M000241"></a>

        <div class="method-heading">
          <a href="#M000241" class="method-signature">
          <span class="method-name">never</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000241-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 261</span>
261:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">never</span>
262:         <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-value">0</span>
263:         <span class="ruby-keyword kw">self</span>
264:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000242" class="method-detail">
        <a name="M000242"></a>

        <div class="method-heading">
          <a href="#M000242" class="method-signature">
          <span class="method-name">once</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000242-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 266</span>
266:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">once</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
267:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
268:         <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-value">1</span>
269:         <span class="ruby-keyword kw">self</span>
270:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000244" class="method-detail">
        <a name="M000244"></a>

        <div class="method-heading">
          <a href="#M000244" class="method-signature">
          <span class="method-name">ordered</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000244-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 278</span>
278:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ordered</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
279:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
280:         <span class="ruby-ivar">@order_group</span>.<span class="ruby-identifier">register</span>(<span class="ruby-keyword kw">self</span>)
281:         <span class="ruby-ivar">@ordered</span> = <span class="ruby-keyword kw">true</span>
282:         <span class="ruby-keyword kw">self</span>
283:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000232" class="method-detail">
        <a name="M000232"></a>

        <div class="method-heading">
          <a href="#M000232" class="method-signature">
          <span class="method-name">similar_messages</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000232-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 214</span>
214:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">similar_messages</span>
215:         <span class="ruby-ivar">@similar_messages</span> <span class="ruby-operator">||=</span> []
216:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000239" class="method-detail">
        <a name="M000239"></a>

        <div class="method-heading">
          <a href="#M000239" class="method-signature">
          <span class="method-name">times</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000239-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 250</span>
250:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">times</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
251:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
252:         <span class="ruby-keyword kw">self</span>
253:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000243" class="method-detail">
        <a name="M000243"></a>

        <div class="method-heading">
          <a href="#M000243" class="method-signature">
          <span class="method-name">twice</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000243-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 272</span>
272:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">twice</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
273:         <span class="ruby-ivar">@method_block</span> = <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
274:         <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-value">2</span>
275:         <span class="ruby-keyword kw">self</span>
276:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000226" class="method-detail">
        <a name="M000226"></a>

        <div class="method-heading">
          <a href="#M000226" class="method-signature">
          <span class="method-name">verify_messages_received</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000226-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000226-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 184</span>
184:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_messages_received</span>   
185:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expected_messages_received?</span>
186:     
187:         <span class="ruby-identifier">generate_error</span>
188:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Mocks</span><span class="ruby-operator">::</span><span class="ruby-constant">MockExpectationError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
189:         <span class="ruby-identifier">error</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-ivar">@expected_from</span>)
190:         <span class="ruby-constant">Kernel</span><span class="ruby-operator">::</span><span class="ruby-identifier">raise</span> <span class="ruby-identifier">error</span>
191:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000235" class="method-detail">
        <a name="M000235"></a>

        <div class="method-heading">
          <a href="#M000235" class="method-signature">
          <span class="method-name">with</span><span class="method-args">(*args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000235-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 230</span>
230:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
231:         <span class="ruby-ivar">@args_expectation</span> = <span class="ruby-constant">ArgumentExpectation</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
232:         <span class="ruby-keyword kw">self</span>
233:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000246" class="method-detail">
        <a name="M000246"></a>

        <div class="method-heading">
          <a href="#M000246" class="method-signature">
          <span class="method-name">set_expected_received_count</span><span class="method-args">(relativity, n)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000246-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb, line 290</span>
290:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_expected_received_count</span>(<span class="ruby-identifier">relativity</span>, <span class="ruby-identifier">n</span>)
291:           <span class="ruby-ivar">@at_least</span> = (<span class="ruby-identifier">relativity</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:at_least</span>)
292:           <span class="ruby-ivar">@at_most</span> = (<span class="ruby-identifier">relativity</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:at_most</span>)
293:           <span class="ruby-ivar">@expected_received_count</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">n</span>
294:             <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Numeric</span>
295:               <span class="ruby-identifier">n</span>
296:             <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:once</span>
297:               <span class="ruby-value">1</span>
298:             <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:twice</span>
299:               <span class="ruby-value">2</span>
300:           <span class="ruby-keyword kw">end</span>
301:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>